Contents | Index | < Browse | Browse >

LETTERfgetposULETTER Reads and saves the current file position.

Overview
#include <stdio.h>

x = fgetpos(fp, posn)

int x;
FILE *fp;
fpos_t *posn;

Portability
ANSI

Description
"fgetpos" saves the current file position of the file pointed to by "fp" in "posn" for later usage with fsetpos.

Returns
On success zero is returned. If the system is not sure about the current position "fgetpos" returns a value unequal zero. In this case a more detailed error code may be obtained from "errno".

See also
fseek , fsetpos , ftell